//
//  test.c
//  链表(C)
//
//  Created by Yan Zihao on 2024/12/15.
//
#include "SList.h"

int main(void)
{
    SLTNode* node1 = SLTBuyNode(1);
    SLTNode* node2 = SLTBuyNode(2);
    SLTNode* node3 = SLTBuyNode(3);
    SLTNode* node4 = SLTBuyNode(4);
    node1->next = node2;
    node2->next = node3;
    node3->next = node4;
    SLTPrint(node1);
    SLTPushBack(&node1, 5);
    SLTPrint(node1);
    SLTPushFront(&node1, 6);
    SLTPrint(node1);
    SLTPopBack(&node1);
    SLTPrint(node1);
    SLTPopFront(&node1);
    SLTPrint(node1);
    SLTNode* find = SLTFind(node1, 3);
    SLTInsert(&node1, find, 8);
    SLTPrint(node1);
    SLTInsertAfter(find, 8);
    SLTPrint(node1);
    SLTEraseAfter(find);
    SLTPrint(node1);
    SLTErase(&node1, find);
    SLTPrint(node1);
    return 0;
}
